import request from '@/utils/request'

// 查询过程检验单行列表
export function templateindexList(query) {
  return request({
    url: '/mes/qc/templateindex/list',
    method: 'get',
    params: query
  })
}
// ?pageNum=1&pageSize=10&templateId=6

// 查询检测项列表
export function listInspection(data) {
  return request({
    url: '/mes/firstlast/inspection/list',
    method: 'post',
    data: data
  })
}

// 获取异常检查项列表
export function listError(query) {
  return request({
    url: 'mes/ipqc/base/inspection/indexType/listByTemplateId',
    method: 'get',
    params: query
  })
}
// 查询检测项详细
export function getInspection(indexId) {
  return request({
    url: '/mes/firstlast/inspection/' + indexId,
    method: 'get'
  })
}

// 新增检测项
export function addInspection(data) {
  return request({
    url: '/mes/firstlast/inspection',
    method: 'post',
    data: data
  })
}

// 修改检测项
export function updateInspection(data) {
  return request({
    url: '/mes/firstlast/inspection',
    method: 'put',
    data: data
  })
}

// 删除检测项
export function delInspection(indexId) {
  return request({
    url: '/mes/firstlast/inspection/' + indexId,
    method: 'delete'
  })
}

//验证SN码是否正确
export function firstcheckSncode(query) {
  return request({
    url: '/mes/firstlast/inspection/foolProofing',
    method: 'get',
    params: query
  })
}


//导出首末检验详情
export function exportDetail(indexId) {
  return request({
    url: '/mes/firstlast/inspection/detail/export/'+ indexId,
    method: 'get',
    responseType: 'blob'
  })
}

/**
 * 导出首末检验列表
 */
export function getExportDataList(data) {
  return request({
    url: '/mes/firstlast/inspection/exportDataList',
    method: 'post',
    data: data, 
  })
}



